Fix warning when moving between paragraphs.
authorOwen Taylor <otaylor@redhat.com>
Mon, 13 Nov 2000 00:30:05 +0000 (00:30 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 13 Nov 2000 00:30:05 +0000 (00:30 +0000)
Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>

* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
Fix warning when moving between paragraphs.

* gtk/gtkentry.[ch]: Change move => move_cursor,
delete => delete_from_cursor, insert => insert_at_cursor

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentry.c
gtk/gtkentry.h
gtk/gtktextlayout.c

index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index 28ed84f9573d2149b1d04e7e427252f714b18422..7ad0e5c2c0f0ca664c9348a29c82ee26ba568947 100644 (file)
@@ -1,3 +1,11 @@
+Sun Nov 12 19:11:42 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_next_line):
+       Fix warning when moving between paragraphs.
+
+       * gtk/gtkentry.[ch]: Change move => move_cursor, 
+       delete => delete_from_cursor, insert => insert_at_cursor
+
 Sun Nov 12 22:52:51 2000  Robert Brady  <robert@suse.co.uk>
 
        * modules/input/imviqr.c: A vietnamese VIQR-based input method.
index a1cb51773b3d1f4509d9134e7522e7f0e59c5658..9996cdd9bbda666202e963bb1ed1f99e3b1f325f 100644 (file)
@@ -144,26 +144,26 @@ static gboolean gtk_entry_get_selection_bounds (GtkEditable *editable,
 
 /* Default signal handlers
  */
-static void gtk_entry_real_insert_text (GtkEntry        *entry,
-                                       const gchar     *new_text,
-                                       gint             new_text_length,
-                                       gint            *position);
-static void gtk_entry_real_delete_text (GtkEntry        *entry,
-                                       gint             start_pos,
-                                       gint             end_pos);
-static void gtk_entry_move             (GtkEntry        *entry,
-                                       GtkMovementStep  step,
-                                       gint             count,
-                                       gboolean         extend_selection);
-static void gtk_entry_insert           (GtkEntry        *entry,
-                                       const gchar     *str);
-static void gtk_entry_delete           (GtkEntry        *entry,
-                                       GtkDeleteType    type,
-                                       gint             count);
-static void gtk_entry_cut_clipboard    (GtkEntry        *entry);
-static void gtk_entry_copy_clipboard   (GtkEntry        *entry);
-static void gtk_entry_paste_clipboard  (GtkEntry        *entry);
-static void gtk_entry_toggle_overwrite (GtkEntry        *entry);
+static void gtk_entry_real_insert_text   (GtkEntry        *entry,
+                                         const gchar     *new_text,
+                                         gint             new_text_length,
+                                         gint            *position);
+static void gtk_entry_real_delete_text   (GtkEntry        *entry,
+                                         gint             start_pos,
+                                         gint             end_pos);
+static void gtk_entry_move_cursor        (GtkEntry        *entry,
+                                         GtkMovementStep  step,
+                                         gint             count,
+                                         gboolean         extend_selection);
+static void gtk_entry_insert_at_cursor   (GtkEntry        *entry,
+                                         const gchar     *str);
+static void gtk_entry_delete_from_cursor (GtkEntry        *entry,
+                                         GtkDeleteType    type,
+                                         gint             count);
+static void gtk_entry_cut_clipboard      (GtkEntry        *entry);
+static void gtk_entry_copy_clipboard     (GtkEntry        *entry);
+static void gtk_entry_paste_clipboard    (GtkEntry        *entry);
+static void gtk_entry_toggle_overwrite   (GtkEntry        *entry);
 
 /* IM Context Callbacks
  */
@@ -333,7 +333,7 @@ gtk_entry_class_init (GtkEntryClass *class)
       gtk_signal_new ("move_cursor",
                       GTK_RUN_LAST | GTK_RUN_ACTION,
                       GTK_CLASS_TYPE (object_class),
-                      GTK_SIGNAL_OFFSET (GtkEntryClass, move),
+                      GTK_SIGNAL_OFFSET (GtkEntryClass, move_cursor),
                       gtk_marshal_VOID__ENUM_INT_BOOLEAN,
                       GTK_TYPE_NONE, 3, GTK_TYPE_MOVEMENT_STEP, GTK_TYPE_INT, GTK_TYPE_BOOL);
 
@@ -341,7 +341,7 @@ gtk_entry_class_init (GtkEntryClass *class)
       gtk_signal_new ("insert_at_cursor",
                       GTK_RUN_LAST | GTK_RUN_ACTION,
                       GTK_CLASS_TYPE (object_class),
-                      GTK_SIGNAL_OFFSET (GtkEntryClass, insert),
+                      GTK_SIGNAL_OFFSET (GtkEntryClass, insert_at_cursor),
                       gtk_marshal_VOID__STRING,
                       GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
 
@@ -349,7 +349,7 @@ gtk_entry_class_init (GtkEntryClass *class)
       gtk_signal_new ("delete_from_cursor",
                       GTK_RUN_LAST | GTK_RUN_ACTION,
                       GTK_CLASS_TYPE (object_class),
-                      GTK_SIGNAL_OFFSET (GtkEntryClass, delete),
+                      GTK_SIGNAL_OFFSET (GtkEntryClass, delete_from_cursor),
                       gtk_marshal_VOID__ENUM_INT,
                       GTK_TYPE_NONE, 2, GTK_TYPE_DELETE_TYPE, GTK_TYPE_INT);
 
@@ -533,9 +533,9 @@ gtk_entry_class_init (GtkEntryClass *class)
 
   class->insert_text = gtk_entry_real_insert_text;
   class->delete_text = gtk_entry_real_delete_text;
-  class->move = gtk_entry_move;
-  class->insert = gtk_entry_insert;
-  class->delete = gtk_entry_delete;
+  class->move_cursor = gtk_entry_move_cursor;
+  class->insert_at_cursor = gtk_entry_insert_at_cursor;
+  class->delete_from_cursor = gtk_entry_delete_from_cursor;
   class->cut_clipboard = gtk_entry_cut_clipboard;
   class->copy_clipboard = gtk_entry_copy_clipboard;
   class->paste_clipboard = gtk_entry_paste_clipboard;
@@ -1377,10 +1377,10 @@ gtk_entry_real_delete_text (GtkEntry *entry,
 
 
 static void
-gtk_entry_move (GtkEntry       *entry,
-               GtkMovementStep step,
-               gint            count,
-               gboolean        extend_selection)
+gtk_entry_move_cursor (GtkEntry       *entry,
+                      GtkMovementStep step,
+                      gint            count,
+                      gboolean        extend_selection)
 {
   gint new_pos = entry->current_pos;
 
@@ -1424,8 +1424,8 @@ gtk_entry_move (GtkEntry       *entry,
 }
 
 static void
-gtk_entry_insert (GtkEntry    *entry,
-                 const gchar *str)
+gtk_entry_insert_at_cursor (GtkEntry    *entry,
+                           const gchar *str)
 {
   GtkEditable *editable = GTK_EDITABLE (entry);
   gint pos = entry->current_pos;
@@ -1437,9 +1437,9 @@ gtk_entry_insert (GtkEntry    *entry,
 }
 
 static void
-gtk_entry_delete (GtkEntry       *entry,
-                 GtkDeleteType   type,
-                 gint            count)
+gtk_entry_delete_from_cursor (GtkEntry       *entry,
+                             GtkDeleteType   type,
+                             gint            count)
 {
   GtkEditable *editable = GTK_EDITABLE (entry);
   gint start_pos = entry->current_pos;
index 765da78f033c693f612c2fb60b3ba8738bca981c..33f26baaff4c27b97a266338bcd17842755f8a14 100644 (file)
@@ -106,20 +106,20 @@ struct _GtkEntryClass
 
   /* Action signals
    */
-  void (* activate)         (GtkEntry       *entry);
-  void (* move)             (GtkEntry       *entry,
-                            GtkMovementStep step,
-                            gint            count,
-                            gboolean        extend_selection);
-  void (* insert)           (GtkEntry       *entry,
-                            const gchar    *str);
-  void (* delete)           (GtkEntry       *entry,
-                            GtkDeleteType   type,
-                            gint            count);
-  void (* cut_clipboard)    (GtkEntry       *entry);
-  void (* copy_clipboard)   (GtkEntry       *entry);
-  void (* paste_clipboard)  (GtkEntry       *entry);
-  void (* toggle_overwrite) (GtkEntry       *entry);
+  void (* activate)           (GtkEntry       *entry);
+  void (* move_cursor)        (GtkEntry       *entry,
+                              GtkMovementStep step,
+                              gint            count,
+                              gboolean        extend_selection);
+  void (* insert_at_cursor)   (GtkEntry       *entry,
+                              const gchar    *str);
+  void (* delete_from_cursor) (GtkEntry       *entry,
+                              GtkDeleteType   type,
+                              gint            count);
+  void (* cut_clipboard)      (GtkEntry       *entry);
+  void (* copy_clipboard)     (GtkEntry       *entry);
+  void (* paste_clipboard)    (GtkEntry       *entry);
+  void (* toggle_overwrite)   (GtkEntry       *entry);
 };
 
 GtkType    gtk_entry_get_type                  (void) G_GNUC_CONST;
index 7487d3d20cb87bd46cbc65db484245ef64a92a30..5bf696a593f3a8593ee8c82affa1b0f55ffc8a48 100644 (file)
@@ -2392,6 +2392,7 @@ gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout,
 
   gboolean found = FALSE;
   gboolean found_after = FALSE;
+  gboolean first = TRUE;
 
   g_return_if_fail (layout != NULL);
   g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
@@ -2405,8 +2406,15 @@ gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout,
       GSList *tmp_list;
 
       display = gtk_text_layout_get_line_display (layout, line, FALSE);
-      line_byte = line_display_iter_to_index (layout, display, iter);
 
+      if (first)
+       {
+         line_byte = line_display_iter_to_index (layout, display, iter);
+         first = FALSE;
+       }
+      else
+       line_byte = 0;
+       
       tmp_list = pango_layout_get_lines (display->layout);
       while (tmp_list && !found_after)
         {